package com.zhentao.subscription.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhentao.subscription.domain.entity.SubscriptionTemplate;
import com.zhentao.subscription.mapper.SubscriptionTemplateMapper;
import com.zhentao.subscription.service.TemplateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TemplateServiceImpl extends ServiceImpl<SubscriptionTemplateMapper, SubscriptionTemplate> implements TemplateService {

    @Autowired
    private SubscriptionTemplateMapper templateMapper;

    @Override
    public IPage<SubscriptionTemplate> getTemplatePage(int pageNo, int pageSize, String keyword) {
        Page<SubscriptionTemplate> page = new Page<>(pageNo, pageSize);
        return templateMapper.selectPageWithKeyword(page, keyword);
    }
}

